Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new hook useMeasure #80

Merged
merged 2 commits into from
May 25, 2021
Merged

feat: new hook useMeasure #80

merged 2 commits into from
May 25, 2021

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented May 24, 2021

What new hook does?

Uses ResizeObserver to track element dimensions and re-render component when they change.

Checklist

  • Have you read contribution guideline?
  • Does the code have comments in hard-to-understand areas?
  • Is there an existing issue for this PR?
  • Have the files been linted and formatted?
  • Have the docs been updated?
  • Have the tests been added to cover new hook?
  • Have you run the tests locally to confirm they pass?

@xobotyi xobotyi added the 🎂 new hook New hook added label May 24, 2021
@xobotyi xobotyi requested a review from JoeDuncko May 24, 2021 10:37
@codecov
Copy link

codecov bot commented May 24, 2021

Codecov Report

Merging #80 (f83b12f) into master (ccf2c26) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #80   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        26    +1     
  Lines          344       355   +11     
  Branches        69        69           
=========================================
+ Hits           344       355   +11     
Impacted Files Coverage Δ
src/useMeasure.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccf2c26...f83b12f. Read the comment docs.

@xobotyi xobotyi force-pushed the master branch 2 times, most recently from 915282c to 5369a94 Compare May 25, 2021 11:18
@JoeDuncko
Copy link
Contributor

Why not just call this "useResize"?

stories/Sensor/useMeasure.story.mdx Outdated Show resolved Hide resolved
stories/Sensor/useMeasure.stories.tsx Outdated Show resolved Hide resolved
@xobotyi
Copy link
Contributor Author

xobotyi commented May 25, 2021

Why not just call this "useResize"?

It does not resize anything? 🤔
I also dont really like useMeasure, but this name is quite widespreaded and looks like most suitable for what it does.

@xobotyi xobotyi merged commit 354efc6 into master May 25, 2021
@xobotyi xobotyi deleted the useMeasure branch May 25, 2021 21:59
github-actions bot pushed a commit that referenced this pull request May 25, 2021
# [1.22.0](v1.21.0...v1.22.0) (2021-05-25)

### Features

* new hook `useMeasure` ([#80](#80)) ([354efc6](354efc6))
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants